<!DOCTYPE HTML>
<html lang="zh">

<head>
    <meta charset="utf-8">
    <title>节点类型</title>
    <script>
    function p(s) {
        document.write("<p class='content'>" + s + "</p>");
    }
    </script>
    <style type="text/css" media="screen">
    body {
        width: 960px;
        margin: 0 auto;
        font: 18px/1.8em '微软雅黑';
    }

    h1 {
        color: green;
    }

    h2 {
        border-bottom: 2px solid green;
        line-height: 1.8em;
    }

    p {
        font-size: 20;
        padding: 5px 0;
        font-weight: bolder;
    }

    p.content {
        font-weight: normal;
        padding-left: 2em;
        line-height: 1.5em;
        margin: 0;
    }
    </style>
</head>

<body>
    <h1 id="title">节点类型</h1>
    <p>document对象属性枚举</p>
    <script>
    var o = document.getElementById('title');
    p(o);
    p(o.nodeType);
    </script>
</body>

</html>
